class_name HitboxComponent
extends Area2D

signal hit_hurtbox(hurtbox_component: HurtboxComponent)

enum ATTRIBUTE_TYPE {普通,寒冰,中毒,治疗,治疗触发术,回蓝触发术,伐树}

@export var damage: float = 1.0

var source_peer_id:int
var is_hit_handled: bool

#伤害属性，冰属性减速，雷属性眩晕，火属性持续伤害，毒属性，瞌睡虫
@export var attribute : ATTRIBUTE_TYPE
#碰触后销毁
@export var is_once_destroy: bool = true


func register_hurtbox_hit(hurtbox_component: HurtboxComponent):
	
	if hurtbox_component.is_not_hurt(self):
		return
	
	hit_hurtbox.emit(hurtbox_component)
